<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

</head>
<body>
<button onclick="myFuction()">加载新文档</button>
    
</body>
</html>
<script>
    function myFuction(){
        window.location.assign("http://www.w3cschool.cc")
    }
    // document.write(location.href) //当前页面的url
    // document.write(location.pathname)//当前页面的路径名



</script>